<template>
    <div>
        <fieldset>
            <legend>父组件</legend>
            提供数据(provide)：{{ color }}
            <PIChild />
        </fieldset>
    </div>
</template>

<script lang="ts">
import { defineComponent, provide, ref } from "vue";
import PIChild from "../components/PIChild.vue";
export default defineComponent({
    components: {
        PIChild,
    },
    setup() {
        const color = ref("red");
        provide("color", color);
        return {
            color,
        };
    },
});
</script>

<style scoped></style>
